]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
theme: Regain focus ring in %bubble_button
authornana-4 <hnmaigo@gmail.com>
Fri, 17 Jan 2020 10:57:42 +0000 (19:57 +0900)
committernana-4 <hnmaigo@gmail.com>
Fri, 17 Jan 2020 12:21:44 +0000 (12:21 +0000)
Instead of removing all button shadows forcibly with
`box-shadow: none !important`, remove only the drop shadows selectively
with button(). This allows %bubble_button to preserve the focus ring
while eliminating the drop shadows.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2088

data/theme/gnome-shell-sass/_common.scss
data/theme/gnome-shell-sass/_drawing.scss

index d014283681c2b73f82a5989143b6a502977bbefc..aea0dbbc314ce98bea30a32927f5bf3210b0e897 100644 (file)
@@ -156,19 +156,18 @@ stage {
 
 // buttons in dialogs
 %bubble_button {
-  @include button(normal);
+  @include button(normal, $shadow: none);
   padding: $base_padding * 2;
   border-color: $bubble_borders_color;
   border-style: solid;
   border-width: 1px;
   border-left-width: 0;
   border-bottom-width: 0;
-  box-shadow:none !important;
 
-  &:insensitive { @include button(insensitive);}
-  &:hover { @include button(hover);}
-  &:focus { @include button(focus);}
-  &:active { @include button(active);}
+  &:insensitive { @include button(insensitive, $shadow: none); }
+  &:hover { @include button(hover, $shadow: none); }
+  &:focus { @include button(focus, $shadow: none); }
+  &:active { @include button(active, $shadow: none); }
 
   // radius is 2 pixel less to fit in bubble
   &:first-child {
index 63f9f6c832f4a07e3c8154b4593f682c56f5890a..03ce04353e6532e319947d5ea6512e91508695f9 100644 (file)
   }
 }
 
-@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: $borders_edge) {
+@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: $borders_edge, $shadow: $shadow_color) {
 //
 // Button drawing function
 //
 // $tc:   optional text color for colored* types
 // $edge: set to none to not draw the bottom edge or specify a color to not
 //        use the default one
+// $shadow: set to none to not draw the drop shadow or specify a color to not
+//          use the default one
 //
 // possible $t values:
 // normal, hover, active, insensitive, insensitive-active,
   $hilight_color: draw_button_hilight_color($c);
   $button_edge: if($edge == none, none, draw_widget_edge($edge));
   $blank_edge: if($edge == none, none, draw_widget_edge(transparentize($edge,1)));
+  $button_shadow: if($shadow == none, none, 0 1px 1px 0 $shadow);
 
   // normal button
   @if $t==normal {
     color: $tc;
     background-color: lighten($c, 3%) !important;
     border-color: draw_border_color($c);
-    @include draw_shadows(0 1px 1px 0 $shadow_color);
+    @include draw_shadows($button_shadow);
     // box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
     text-shadow: 0 1px $text_shadow_color;
     icon-shadow: 0 1px $text_shadow_color;
     //border-color: $selected_bg_color;
   }
 
-  // hover osd button
+  // hover button
   @else if $t==hover {
     color: $tc;
     background-color: lighten($c, if($variant == 'light', 8%, 5%)) !important;
     border-color: if($variant == 'light', draw_border_color(lighten($c, 7%)), draw_border_color($c));
-    @include draw_shadows(0 1px 1px 0 $shadow_color);
+    @include draw_shadows($button_shadow);
     text-shadow: 0 1px $text_shadow_color;
     icon-shadow: 0 1px $text_shadow_color;
   }
 
-  // active osd button
+  // active button
   @else if $t==active {
     color: $tc;
     background-color: darken($c,3%) !important;